-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check .shtml files for noindex directives #50
Conversation
That's part of it. That alone will just cause the action to search for noindex directives within shtml files, excluding those that have it. Without your change, it currently just looks for noindex in files with extension html or htm. The index.html is dropped from the url somewhere else. |
Oh nice! that would definitely help out for some of the older .shtml sites we keep on github. Is this the other part here? I could add a elif f == "index.shtml" : To the pull request also.
|
@TravisBrace Yes, the sortname function is where that is handled. Or at least now it is. While looking at code to confirm your question I noticed I had some redundancy in there. I just committed a change to your PR to remove the redundancy so that the other place with that logic now just calls the sortname function. I think you should now be able to add the elif you mentioned. You might actually need two of them. You'll notice the first if checks if the file path ends with "/index.html" and the elif after that checks if the path equals "index.html" (no slash). If I remember correctly, the reason it's not simply checking if it ends with "index.html" is for the possibly unlikely case of a filename like "somethingindex.html". |
Hoping adding "shtml" would help treat index.shtml pages the same as index.html pages removing the from sitemap so pages end in / tests shtml as html extension Co-Authored-By: Travis Brace <TravisBrace@gmail.com> Co-Authored-By: Vincent A. Cicirello <762030+cicirello@users.noreply.github.com>
@TravisBrace I'm going to merge this now since it handles checking head of .shtml files for noindex directives. I created an issue for the thing you really want, dropping index.shtml from URLs. Feel free to submit an additional PR for that one. It should just involve changing the sortname function. |
Summary
Checks .shtml files for noindex directives in the head.
Hoping adding "shtml" would help treat index.shtml pages the same as index.html pages removing the from sitemap so pages end in /
Closing Issues
Closes #51
Types of changes